@import "~themes/vars";

.layout {
  position: relative;
  height: 100vh;

  &.withnavbar {
    .main {
      margin-left: 0;
    }

    .headerAffix {
      position: absolute;
      right: 0;
      top: 0;
      left: 0;
      transition: @header-transition-ease-in;
    }
  }

  &.collapsed {
    .logo {
      img {
        width: 28px;
        margin: 6px 7px;
      }
    }

    .headerAffix {
      position: absolute;
      right: 0;
      top: 0;
      left: 80px;
      transition: @header-transition-ease-in;
    }
  }


  .headerAffix {
    position: absolute;
    right: 0;
    top: 0;
    left: 200px;
    transition: @header-transition-ease-out;
  }

  .sider {
    height: 100vh;
    background-color: #3e3e3e;
    .logo {
      text-align: center;
      height: 67px;
      line-height: 67px;
      cursor: pointer;
      margin: 0 auto;
      transition: @transition-ease-out;
      overflow: hidden;

      img {
        width: 40px;
        margin-right: 8px;
        transition: @transition-ease-out;
      }

      span {
        vertical-align: text-bottom;
        font-size: 16px;
        text-transform: uppercase;
        display: inline-block;
      }

      .anticon {
        transition: @transition-ease-out;
      }
    }

    :global {
      .ant-menu-dark,
      .ant-menu-dark .ant-menu-sub {
        color: #999;
      }

      .ant-menu-root {
        height: ~"calc(100vh - 144px)";
        overflow-x: hidden;
        border-right: none;

        &::-webkit-scrollbar-thumb {
          background-color: transparent;
        }

        &:hover {
          &::-webkit-scrollbar-thumb {
            background-color: rgba(0, 0, 0, 0.2);
          }
        }

        &.ant-menu-vertical {
          .ant-menu-sub {
            height: 0;
            opacity: 0;
            transition: none;
          }

          .ant-menu-submenu-active {
            .ant-menu-sub {
              height: auto;
              opacity: 1;
            }
          }
        }
      }

      .ant-menu {
        transition: @transition-ease-out;

        .ant-menu-item,
        .ant-menu-submenu-title {
          overflow: hidden;
          white-space: normal;
        }
      }
    }
  }



  .main {

    overflow: auto;
    height: 100vh;
    transition: @transition-ease-out;

    :global {
      .content-inner {
        background: #fff;
        padding: 24px;
        box-shadow: @shadow-1;
        min-height: e("calc(100vh - 184px)");
      }
    }

    .container {
      margin: 67px 24px 16px;
      overflow: initial;
    }

    .content {
      min-height: e("calc(100vh - 184px)");
      position: relative;
    }

  }
}

:global .ant-menu-dark {
  color: #999;
  background-color: #3e3e3e;

  .ant-menu-submenu-title:hover,
  .ant-menu-submenu:hover {
    color: @primary-color;
  }

  .ant-menu-sub {
    color: #999;
  }

  .ant-menu-submenu-selected {
    color: @primary-color;

    &:not(.ant-menu-submenu-open) {
      background-color: @dark-half;
    }
  }

  .ant-menu-item,
  .ant-menu-submenu-title {
    & > a {
      color: #999;
    }

    &:hover > a {
      color: @primary-color;
    }
  }

  &.ant-menu-inline {
    .ant-menu-item-selected {
      background-color: @dark-half;
    }
  }

  .ant-menu-item-selected {
    color: @primary-color;
    background-color: @dark-half;

    & > a {
      color: @primary-color;
    }

    &:hover {
      background-color: @dark-half;
    }
  }

  &.ant-menu-submenu-popup {
    .ant-menu-item-selected {
      background-color: @dark-half;
    }
  }

  &.ant-menu-inline-collapsed {

    .ant-menu-item-selected {
      background-color: @dark-half;
    }
  }
}

.spin {
  :global .ant-spin-container {
    height: 100vh;
  }
}

@media (max-width: 767px) {
  .layout {

    .main {
      .container {
        margin: 67px 12px 12px;
      }

      .bread {
        padding: 0 12px;
      }

      .content {
        min-height: e("calc(100vh - 160px)");
      }

      :global {
        .content-inner {
          padding: 12px;
          min-height: e("calc(100vh - 160px)");
        }
      }
    }
  }
}
